#ifndef FILELIST_H
#define FILELIST_H

#include "list.h"
#include <pthread.h>

struct s_FileList
{
    List files;
    List socket;
    pthread_mutex_t mutex;
} typedef FileList;

enum e_FileState
{
    FILESTATE_NOTEXIST,
    FILESTATE_RESERVED,
    FILESTATE_EXIST
} typedef FileState;

void fileList_create(FileList** fileList);

void fileList_initialize(FileList* fileList);

void fileList_clear(FileList* fileList);

void fileList_destroy(FileList** fileList);

FileState fileList_getFile(FileList* fileList, const char *filename, int socket);

int fileList_freeFile(FileList* fileList, const char* filename, int socket);

int fileList_freeClient(FileList* fileList, int socket);

#endif /* FILELIST_H*/
